/*
** calcul_coord.c for zappy in /home/guidet_m/TECK2/projets/zappy/server_zappy
** 
** Made by michael guidet
** Login   <guidet_m@epitech.net>
** 
** Started on  Tue Jul  5 10:24:59 2011 michael guidet
** Last update Mon Jul 11 10:03:20 2011 michael guidet
*/

#include "server.h"

void	broadcast_pos(t_coord src, t_coord dest, t_coord *new, t_env *e)
{
  if (ABS(dest.x - src.x) < ABS((dest.x + e->width) - src.x))
    (new->x) = dest.x - src.x;
  else
    (new->x) = (dest.x + e->width) - src.x;
  if (ABS(dest.x - src.y) < ABS((dest.y + e->height) - src.y))
    (new->y) = dest.y - src.y;
  else
    (new->y) = (dest.y + e->height) - src.y;
}
